<template>
  <Wrapper class="t">
    <el-table
      :data="contentList"
      border
      fit="true"
      empty-text="暂无数据"
      :default-sort="{prop: 'date', order: 'descending'}"
    >
      <el-table-column
        v-for="i, p in labelList"
        :key="p"
        :prop="i.prop"
        :label="i.label"
        :width="i.width"
      />
      <el-table-column label="操作" width="300" align="center">
        <template slot-scope="scope">
          <el-button size="mini" icon="el-icon-edit" @click="delTabColOne(scope)">编辑</el-button>
          <el-button size="mini" icon="el-icon-edit" @click="delTabColOne(scope)">详情</el-button>
          <el-button size="mini" icon="el-icon-edit" @click="delTabColOne(scope)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="buttonGroup">
      <el-button size="mini">全部选择</el-button>
      <el-button size="mini">全部选择</el-button>
      <el-dropdown style="margin-left:10px">
        <el-button size="mini">
          更多操作<i class="el-icon-arrow-down el-icon--right" />
        </el-button>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>批量删除</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      <el-pagination
        background
        :page-sizes="[10, 20, 30, 40]"
        :current-page.sync="currentPage3"
        :page-size="10"
        layout="prev, pager, next,sizes"
        :total="1000"
        style="display: inline-block;float: right; "
      />
    </div>
  </wrapper>
</template>

<script>
export default {
  props: {
    labelList: {
      type: Array,
      default() {
        return {}
      }
    }, contentList: {
      type: Array,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      currentPage3: 2,
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 '
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 '
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 '
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 '
      }]
    }
  },
  watch: {
    currentPage3(newVal, oldVal) {
      console.log(newVal)
    }
  },
  created() {
    for (var i in this.contentList) {
      console.log(this.contentList[i])
    }
  }
}
</script>
<style lang="scss" scoped>
.t{
width:1190px;
height: 580px;
.buttonGroup{
  margin-top: 18px;
  line-height: 28px;
}
}
</style>
